﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _0327数组_哈希数组
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a1 = { 1, 3, 6, 9 };
            Console.WriteLine("a1:");
            foreach (int j in a1)
            {
                Console.Write(" {0}", j);
            }
            Console.WriteLine("");

            int[] a2 = new int[6];
            for (int i=0; i < a2.Length; i++)
            {
                a2[i] = i;
            }
            Console.WriteLine("a2:");
            foreach(int j in a2){
                Console.Write(" {0}", j);
            }
            Console.WriteLine("");



            //      二维数组的 定义
           // int[,] arr1 = new int[2, 3];//定长二维数组
           //int[][] arr2 = new int[2][];//非定长二维数组


            int[][] a3 = new int[2][];
            a3[0] = new int[4];
            a3[1] = new int[5];
            Console.WriteLine("a3.a3.GetLength(0) = {0}",a3.GetLength(0));
            Console.WriteLine("非定长数组 a3 :");
            for (int k = 0; k < a3.GetLength(0); k++)
            {
                for (int m = 0; m <a3[k].GetLength(0); m++)
                {
                    Console.Write("{0}  ", k + m);
                }
            }
            int[][] a4 = new int[1][];
            a4[0] = new int[4];
            Console.ReadKey();
        }
    }
}
